package com.isoft.demooa.service.employee;

import com.isoft.demooa.dao.employee.NormalMapper;
import com.isoft.demooa.entity.ResponseMessage;
import com.isoft.demooa.entity.employee.Normal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class NormalService {

     @Autowired
     private NormalMapper normalMapper;


     public List<Normal> getList(){
         return  normalMapper.selectAll();
     }


     public ResponseMessage edit(Normal normal){

         ResponseMessage responseMessage = new ResponseMessage();

         if(normalMapper.update(normal)>0){
             responseMessage.setFlag(true);
         }
         return  responseMessage;
     }


    public ResponseMessage add(Normal normal){

        ResponseMessage responseMessage = new ResponseMessage();

        if(normalMapper.insert(normal)>0){
            responseMessage.setFlag(true);
        }
        return  responseMessage;
    }


}
